<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace frontend\controllers;

use \bc\model\ItemModel;

class ItemController extends \bc\controller\FrontController{
    
    public function actionIndex()
    {   
        //var_dump($_POST);die();
        $request = \Yii::$app->request;
        $id = $request -> get('id');        
        $model = new ItemModel();
        $item_list = $model->getItemByProductId($id); 
        
        $data=array(
                "msg"=>"获取成功",
	            "result"=>1,
	            "data"=>$item_list
        );
        
                
        $json_data = json_encode($data,JSON_UNESCAPED_UNICODE);
        $jsoncallback = htmlspecialchars($_REQUEST['jsoncallback']);
        echo $jsoncallback."(".$json_data.")";
    }

    
}

